<?php
declare (strict_types = 1);

namespace app\business\validate;

use think\Validate;

class Product extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title'  => 'require',
        'cate_1'  => 'require',
        'cate_2'  => 'require',
        'cate_3'  => 'require',
        'skus'  => 'require',
        'images'  => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [

        'title.require' => '请填写商品名称',
        'cate_1.require'   => '请选择一级分类',
        'cate_2.require'   => '请选择二级分类',
        'cate_3.require'   => '请选择三级分类',
        'skus.require'   => '请选择相关规格，并填写sku表',
        'images.require'   => '请上传商品图片',
    ];
}
